{% extends "base.html" %}
{% load news_calendar %}

{% block css %}
	{{block.super}}
    <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/news.css" >
{% endblock css %}

{% block content %}
<div class="topcontent">
    <table border="0" cellspacing="0" cellpadding="0" class="fullwidth">
        <tr>
		{% if course.events_table_percent < 100.0 %}
            <td style="vertical-align: top;">
            {% if announcements or not options.announcements.hide_empty_announcements.value %}
            <div class="Announcements">
                {% if options.announcements.show_announcements_title.value %}<h1><a href="{% course_url apps.news.views.index %}" class="AnnouncementTitleLink">{{options.announcements.announcements_title.value}}</a></h1>{% endif %}
                
            {% if announcements %}
                <table  border="0">
                {% for item in announcements %}
                    <tr><td><h3>{{item.date|date:"m/d/y"}} - {{item.title|safe}}</h3></td></tr>
                    {% if options.announcements.show_full_text %}<tr><td>{{item.description|safe}}</td></tr>{% endif %}
                    <tr></tr>
                {% endfor %}
                </table>
            {% else %}
                <p>{{options.announcements.empty_announcements_text.value}}</p>
            {% endif %}
            </div>
            {% endif %}
            </td>
		{% endif %}
            <td style="width: {{course.event_calendar_percent}}%;">
				<table border=0 class="news_calendar_container">
					<tr>
						<td width='1'>
							{% if month == 1 %}
								<a href="?month=12&year={{year|add:'-1'}}" class=""> << </a>
							{% else %}
								<a href="?month={{month|add:'-1'}}&year={{year}}" class=""> << </a>
							{% endif %}
						</td>
						<td>{% calendar objects=events year=year month=month %} </td>
						<td width='1'>
							{% if month == 12 %}
								<a href="?month=1&year={{year|add:'1'}}" class=""> >> </a>
							{% else %}
								<a href="?month={{month|add:'1'}}&year={{year}}" class=""> >> </a>
							{% endif %}
						</td>
					</tr>
				</table>
            </td>
		</tr>
		<tr>
            <td colspan="3" style="vertical-align:bottom; text-align: right;">
                <a href="{% course_url feed-index %}"><img class="noborder" src="{{ STATIC_URL }}images/feed-icon.png" alt="{{course.course_title}} Feeds" title="{{course.course_title}} Feeds"></a>
            </td>
		</tr>
			{% if course.events_table_percent >= 100.0 %}
		<tr>
				<td style="vertical-align: top;">
				{% if announcements or not options.announcements.hide_empty_announcements.value %}
				<div class="Announcements">
					{% if options.announcements.show_announcements_title.value %}<h1><a href="{% course_url apps.news.views.index %}" class="AnnouncementTitleLink">{{options.announcements.announcements_title.value}}</a></h1>{% endif %}
					
				{% if announcements %}
					<table  border="0">
					{% for item in announcements %}
						<tr><td><h3>{{item.date|date:"m/d/y"}} - {{item.title|safe}}</h3></td></tr>
						{% if options.announcements.show_full_text %}<tr><td>{{item.description|safe}}</td></tr>{% endif %}
						<tr></tr>
					{% endfor %}
					</table>
				{% else %}
					<p>{{options.announcements.empty_announcements_text.value}}</p>
				{% endif %}
				</div>
				{% endif %}
				</td>
        </tr>
			{% endif %}
    </table>
	    
</div>
<div class="bottomcontent">
        {% if course.course_description %}
	    <hr>
	    {% render course.course_description %}
		{% endif%}
</div>
{% endblock content %}
